class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  
  protect_from_forgery
  
  before_filter :authenticate
  
  #TODO: Finestra popup per operazioni e servizi
  
  private
    def authenticate
      authenticate_or_request_with_http_basic do |user_name, password|
        user = Operator.find_by_login(user_name)
        if user != nil
          user.password == password
        end
      end
    end
end
